<%@ page isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <title>查看学生</title>
  <link href="bootstrap.css" rel="stylesheet">
  <style>
    #input01{
      width: 120px;
    }
  </style>
</head>
<body>
<div class="container">
  <table class="table table-striped">
    <thead>
    <div>
      <form action="${pageContext.request.contextPath}/show?method=showMsg&page=${list.page}" method="post">
        <tr>
          <th></th>
          <th></th>
          <th></th>
          <th style="font-size: 25px">查看学生</th>
          <th></th>
          <th></th>
          <th><a href="successAdmin.jsp" class="btn btn-danger btn-sm" role="button">返回</a></th>
        </tr>
      </form>
    </div>
    <tr>
      <th scope="col">编号</th>
      <th scope="col">姓名</th>
      <th scope="col">学号</th>
      <th scope="col">身份证号</th>
      <th scope="col">入学时间</th>
      <th scope="col">权限</th>
      <th scope="col">操作</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${stuInfo.pageMsg}" var="pro" varStatus="status">
      <tr>
        <td>${pro.id}</td>
        <td>${pro.stuName}</td>
        <td>${pro.stuNo}</td>
        <td>${pro.idCard}</td>
        <td>${pro.startDate}</td>
        <td>
          <c:if test="${pro.status==1}">
            管理员
          </c:if>
          <c:if test="${pro.status==0}">
            普通用户
          </c:if>
        </td>
        <td>
          <a href="${pageContext.request.contextPath}/show?method=delete&id=${pro.id}" class="btn btn-danger btn-sm" role="button" onclick="return confirm('确定要删除吗？');">删除</a>
        </td>
      </tr>
    </c:forEach>
    </tbody>
  </table>
  <nav aria-label="...">
    <ul class="pagination">
      <li class="page-item">
        <a class="page-link"
           href="${pageContext.request.contextPath}/show?method=showMsg&page=${stuInfo.page<=1?stuInfo.page:stuInfo.page-1}">上一页</a>
      </li>
      <c:forEach begin="1" end="${stuInfo.countPage}" step="1" varStatus="status" var="p">
        <li class="page-item"><a class="page-link"
                                 href="${pageContext.request.contextPath}/show?method=showMsg&page=${p}">${p}</a></li>
      </c:forEach>
      <li class="page-item">
        <a class="page-link"
           href="${pageContext.request.contextPath}/show?method=showMsg&page=${stuInfo.page==stuInfo.countPage?stuInfo.countPage:stuInfo.page+1}">下一页</a>
      </li>
    </ul>
  </nav>

</div>
</body>
</html>
